package com.Telien.app.utils;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class TelienConfig {
	private String propFileName = "config.properties";
	private Properties prop;

	public TelienConfig(){
		prop = new Properties();
		InputStream inputStream = getClass().getClassLoader().getResourceAsStream(propFileName);
		 
		if (inputStream != null) {
			try {
				prop.load(inputStream);
			} catch (IOException e) {
				System.out.println("Error Loading Properties Files.");
				e.printStackTrace();
			}
		} else {
			System.out.println("Unable to Load Properties Files.");
		}
	}
	
	public String getProperty(String key){
		String value = prop.getProperty(key);
		if(value.equals("") || value == null){
			System.out.println("No Property for key:"+key);
		}
		return value;
	}
}
